<template>
	<div id="now">
		<ul>
			<li v-for="item in nowList" :key="item.id">
				<div class="first">
					<img :src="item.img" alt="">
				</div>
			
			<div class="second">
				<p class="title">{{item.title}}</p>
				<p><span>观众评</span><span>{{item.score}}</span></p>
				<p class="actors">{{item.actors}}</p>
				<p>{{item.nums}}</p>
			</div>
			<div class="three">
					<button>购票</button>
			</div>
			</li>
		</ul>
	</div>
</template>

<script>
	export default {
		name:'Now',
		methods: {
			getNowData() {
				var that = this;
				axios.get('/mock/nowList.json')
					.then(function(response) {
						console.log(response);
						if (response.status == 200) {
							if (response && response.data) {
								that.nowList = response.data.nowList;
							}
						}
					})
					.catch(function(error) {
						console.log(error);
					});
			}
		},
		created() {
			this.getNowData()();
		},
		data(){
			return{
				nowList:[]
			}
		}
	}
</script>

<style scoped="scoped">
	#now{
		width: 100%;
		padding-bottom: 50px;
	}
	img{
		width: 80px;
	}
	div{
		float: left;
	}
	.first{
		width: 25%;
		margin-right: 5px;
	}
	.second{
		width: 55%;
	}
	.actors{
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	li{
		overflow: hidden;
		margin: 10px;
		padding: 10px;
		border-bottom: 1px solid #ccc;
	}
	.three{
		width: 15%;
		text-align: center;
		line-height: 100px;
	}
	.title{
		font-size: 20px;
		font-weight: bold;
	}
	p{
		line-height: 26px;
	}
	.second>p:nth-of-type(4), .second>p:nth-of-type(2), .second>p:nth-of-type(3) {
		color: #666;
	}
	.second>p:nth-of-type(2)>span:nth-of-type(2){
		color: #f90;
		margin-left: 5px;
	}
	button{
		background-color: #e54847;
		color: white;
		width: 45px;
		height: 30px;
		border: none;
		border-radius: 5px;
		
	}
</style>
